package com.angel.test.mock;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.angel.architecture.exceptions.BusinessException;
//TODO Remove?
public class MockHttpServletRequest implements HttpServletRequest {
	public Map<String, Object> map = new HashMap<String, Object>();

	public HttpSession session = new MockHttpSession();

	public void setAttribute(String key, Object o) {
		map.put(key, o);
	}

	public Object getAttribute(String key) {
		return map.get(key);
	}

	public HttpSession getSession() {
		return session;
	}

	// Not implemented from now on.
	public Map<String, Object> getParameterMap() {
		throw new BusinessException("No implementado");
	}

	public String getAuthType() {
		throw new BusinessException("No implementado");
	}

	public Cookie[] getCookies() {
		throw new BusinessException("No implementado");
	}

	public long getDateHeader(String arg0) {
		throw new BusinessException("No implementado");
	}

	public String getHeader(String arg0) {
		throw new BusinessException("No implementado");
	}

	public Enumeration<Object> getHeaders(String arg0) {
		throw new BusinessException("No implementado");
	}

	public Enumeration<Object> getHeaderNames() {
		throw new BusinessException("No implementado");
	}

	public int getIntHeader(String arg0) {
		throw new BusinessException("No implementado");
	}

	public String getMethod() {
		throw new BusinessException("No implementado");
	}

	public String getPathInfo() {
		throw new BusinessException("No implementado");
	}

	public String getPathTranslated() {
		throw new BusinessException("No implementado");
	}

	public String getContextPath() {
		throw new BusinessException("No implementado");
	}

	public String getQueryString() {
		throw new BusinessException("No implementado");
	}

	public String getRemoteUser() {
		throw new BusinessException("No implementado");
	}

	public boolean isUserInRole(String arg0) {
		throw new BusinessException("No implementado");
	}

	public Principal getUserPrincipal() {
		throw new BusinessException("No implementado");
	}

	public String getRequestedSessionId() {
		throw new BusinessException("No implementado");
	}

	public String getRequestURI() {
		throw new BusinessException("No implementado");
	}

	public StringBuffer getRequestURL() {
		throw new BusinessException("No implementado");
	}

	public String getServletPath() {
		throw new BusinessException("No implementado");
	}

	public HttpSession getSession(boolean arg0) {
		return this.getSession();
	}

	public boolean isRequestedSessionIdValid() {
		throw new BusinessException("No implementado");
	}

	public boolean isRequestedSessionIdFromCookie() {
		throw new BusinessException("No implementado");
	}

	public boolean isRequestedSessionIdFromURL() {
		throw new BusinessException("No implementado");
	}

	public boolean isRequestedSessionIdFromUrl() {
		throw new BusinessException("No implementado");
	}

	public Enumeration<Object> getAttributeNames() {
		throw new BusinessException("No implementado");
	}

	public String getCharacterEncoding() {
		throw new BusinessException("No implementado");
	}

	public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException {
		throw new BusinessException("No implementado");
	}

	public int getContentLength() {
		throw new BusinessException("No implementado");
	}

	public String getContentType() {
		throw new BusinessException("No implementado");
	}

	public ServletInputStream getInputStream() throws IOException {
		throw new BusinessException("No implementado");
	}

	public String getParameter(String arg0) {
		throw new BusinessException("No implementado");
	}

	public Enumeration<Object> getParameterNames() {
		throw new BusinessException("No implementado");
	}

	public String[] getParameterValues(String arg0) {
		throw new BusinessException("No implementado");
	}

	public String getProtocol() {
		throw new BusinessException("No implementado");
	}

	public String getScheme() {
		throw new BusinessException("No implementado");
	}

	public String getServerName() {
		throw new BusinessException("No implementado");
	}

	public int getServerPort() {
		throw new BusinessException("No implementado");
	}

	public BufferedReader getReader() throws IOException {
		throw new BusinessException("No implementado");
	}

	public String getRemoteAddr() {
		throw new BusinessException("No implementado");
	}

	public String getRemoteHost() {
		throw new BusinessException("No implementado");
	}

	public void removeAttribute(String arg0) {
		throw new BusinessException("No implementado");
	}

	public Locale getLocale() {
		throw new BusinessException("No implementado");
	}

	public Enumeration<Object> getLocales() {
		throw new BusinessException("No implementado");
	}

	public boolean isSecure() {
		throw new BusinessException("No implementado");
	}

	public RequestDispatcher getRequestDispatcher(String arg0) {
		throw new BusinessException("No implementado");
	}

	public String getRealPath(String arg0) {
		throw new BusinessException("No implementado");
	}

	public int getRemotePort() {
		throw new BusinessException("No implementado");
	}

	public String getLocalName() {
		throw new BusinessException("No implementado");
	}

	public String getLocalAddr() {
		throw new BusinessException("No implementado");
	}

	public int getLocalPort() {
		throw new BusinessException("No implementado");
	}
}